<template>
	<view class="wrap">
		<view class="content">
			<u--form ref="uForm" :model="driveInfo" :labelStyle="{color: '#333', fontSize: '30rpx', fontWeight: '500'}">
				<view class="item">
					<view class="title between">
						<view>所属项目</view>
						<view class="set" @click="goRelation" v-if="user_project.length">
							<text style="margin-right: 6rpx;">管理</text>
							<u-icon name="arrow-right" size="14"></u-icon>
						</view>
					</view>
					<view class="unselected" @click="goAdd" v-if="!user_project.length">
						<view class="flex">
							<u-icon name="order" size="30" color="#9E9E9E"></u-icon>
							<view style="margin-left: 24rpx;">点击添加项目</view>
						</view>
					</view>
					<view class="items" v-else>
						<view class="info">
							<view class="name" v-for="(item, index) in user_project" :key="index"
								v-show="isShowMore(index)">
								{{item.project_name}}
							</view>
						</view>
						<view class="fold" @click="triggerShow" v-if="user_project.length > 3">
							<view v-if="!showMore">
								<text style="margin-right: 12rpx;">展开全部</text>
								<u-icon name="arrow-down-fill" color="#9E9E9E" size="10"></u-icon>
							</view>
							<view v-else>
								<text style="margin-right: 12rpx;">收起全部</text>
								<u-icon name="arrow-up-fill" color="#9E9E9E" size="10"></u-icon>
							</view>
						</view>
					</view>
				</view>
				<view class="item">
					<view class="title">请确认个人信息</view>
					<view class="info-wrap">
						<u-form-item label="真实姓名" required labelWidth="200rpx" borderBottom>
							<u--input v-model="driveInfo.driverName" placeholder="请上传身份证，系统自动识别" fontSize="30rpx"
								inputAlign="right" :disabled="disableIdcard" disabledColor="#fff">
							</u--input>
						</u-form-item>
						<u-form-item label="身份证号" required labelWidth="200rpx" borderBottom>
							<u--input v-model="driveInfo.idcard" type="idcard" placeholder="请上传身份证，系统自动识别"
								fontSize="30rpx" inputAlign="right" :disabled="disableIdcard" disabledColor="#fff">
							</u--input>
						</u-form-item>
						<u-form-item label="手机号" required labelWidth="200rpx">
							<u--input v-model="driveInfo.mobile" type="number" placeholder="手动输入手机号码" fontSize="30rpx"
								inputAlign="right" :disabled="disableMobile" disabledColor="#fff" maxlength="11">
							</u--input>
						</u-form-item>
					</view>
				</view>
				<view class="item">
					<view class="title">请上传本人有效身份证</view>
					<view class="info-wrap">
						<view class="upload-box">
							<view class="upload-item">
								<u-upload :fileList="fileIdcard" name="Idcard" @afterRead="afterReadIdcard"
									@delete="deletePic" :maxCount="1" width="326rpx" height="200rpx">
									<image src="@/static/bg_upload_1.png" style="width: 326rpx;height: 200rpx;">
									</image>
								</u-upload>
								<view class="desc">身份证正页</view>
							</view>
							<view class="upload-item">
								<u-upload :fileList="fileIdcardBack" name="IdcardBack" @afterRead="afterReadIdcardBack"
									@delete="deletePic" :maxCount="1" width="326rpx" height="200rpx">
									<image src="@/static/bg_upload_2.png" style="width: 326rpx;height: 200rpx;">
									</image>
								</u-upload>
								<view class="desc">身份证副页</view>
							</view>
						</view>
					</view>
				</view>
				<view class="item">
					<view class="title">请上传驾驶证</view>
					<view class="info-wrap">
						<view class="upload-box">
							<view class="upload-item">
								<u-upload :fileList="fileDriving" name="Driving" @afterRead="afterReadDriving"
									@delete="deletePic" :maxCount="1" width="326rpx" height="200rpx">
									<image src="@/static/bg_upload_1.png" style="width: 326rpx;height: 200rpx;">
									</image>
								</u-upload>
								<view class="desc">驾驶证正页</view>
							</view>
							<view class="upload-item">
								<u-upload :fileList="fileDrivingBack" name="DrivingBack" @afterRead="afterRead"
									@delete="deletePic" :maxCount="1" width="326rpx" height="200rpx">
									<image src="@/static/bg_upload_2.png" style="width: 326rpx;height: 200rpx;">
									</image>
								</u-upload>
								<view class="desc">驾驶证副页</view>
							</view>
						</view>
					</view>
				</view>
				<view class="item">
					<view class="title">请上传本人有效从业资格证</view>
					<view class="info-wrap">
						<view class="upload-box">
							<view class="upload-item">
								<u-upload :fileList="fileTqc" name="Tqc" @afterRead="afterReadTqc" @delete="deletePic"
									:maxCount="1" width="326rpx" height="200rpx">
									<image src="@/static/bg_upload_1.png" style="width: 326rpx;height: 200rpx;">
									</image>
								</u-upload>
								<view class="desc">从业资格证正页</view>
							</view>
							<view class="upload-item">
								<u-upload :fileList="fileTqcBack" name="TqcBack" @afterRead="afterRead"
									@delete="deletePic" :maxCount="1" width="326rpx" height="200rpx">
									<image src="@/static/bg_upload_2.png" style="width: 326rpx;height: 200rpx;">
									</image>
								</u-upload>
								<view class="desc">从业资格证副页</view>
							</view>
						</view>
						<view class="tips">温馨提示：根据交通运输部关于网络货运的监督要求，我们需要您提供真实的身份信息进行司机身份的认证</view>
					</view>
				</view>
			</u--form>
		</view>
		<view class="bottom-wrap">
			<view class="submit" @click="submit">提交</view>
		</view>

		<u-modal :show="showModal" :content='contentModal' :closeOnClickOverlay="true" @confirm="confirm"
			@cancel="showModal = false" @close="showModal = false" confirmText="去申诉" :showCancelButton="true"></u-modal>

	</view>
</template>

<script>
	import {
		driverRegister,
		getIp,
		checkIdCardUnique,
		driverDetail,
		driverUpdate
	} from '@/config/api/app.js'
	import {
		mapMutations,
		mapGetters
	} from 'vuex'
	import Cache from '@/utils/cache'
	import {
		formatDate
	} from '@/utils/tools'
	export default {
		data() {
			return {
				user_project: [],
				showMore: false,

				fileIdcard: [],
				fileIdcardBack: [],
				fileDriving: [],
				fileDrivingBack: [],
				fileTqc: [],
				fileTqcBack: [],

				type: '',
				driverId: '',
				driveInfo: {
					projectIds: [],
					driverName: '',
					idcard: '',
					mobile: '',
					etpId: Cache.get("USERINFO")[0].etpId,
					isAddDriver: 0
				},
				disableIdcard: true,
				disableMobile: false,

				showModal: false,
				contentModal: ''
			}
		},
		created() {
			this.user_project = this.selectProject
			this.getIp()
			Cache.set("isAddDriver",0)
			console.log(Cache.get("isAddDriver"),111111111)
		},
		onShow() {
			this.user_project = this.selectProject
		},
		async onLoad(options) {
			if (options.id) {
				this.driverId = options.id
				this.type = 1 // 1是编辑
				
				
				await this.getEditDetail(this.driverId)
			}
		},
		beforeDestroy() {
			this.SAVESELECTPROJECT(null)
		},
		methods: {
			...mapMutations(['SAVESELECTPROJECT']),
			//	获取编辑的司机信息
			getEditDetail(id) {
				let parmas = {
					driver_id: id
				}
				driverDetail({
					params: parmas
				}).then((res) => {
					console.log(res.data)
					if (res.code == 0) {
						this.disableIdcard = false
						this.disableMobile = true
						this.SAVESELECTPROJECT(res.data.user_project)
						this.user_project = res.data.user_project
						this.driveInfo.driverName = res.data.driver.driverName
						this.driveInfo.idcard1 = res.data.driver.idcard1
						this.driveInfo.idcard2 = res.data.driver.idcard2
						this.driveInfo.driverLicense = res.data.driver.drivingLicenseDeputy
						this.driveInfo.tqcDeputy = res.data.driver.tqcDeputy
						this.driveInfo.tqc = res.data.driver.tqc
						this.driveInfo.idcard = res.data.driver.idcard
						this.driveInfo.mobile = res.data.driver.mobile
						this.driveInfo.driverNameOcrIdcard = res.data.driver.driverNameOcrIdcard
						this.driveInfo.idOcrIdcard = res.data.driver.idOcrIdcard
						this.driveInfo.idOcrDriverLicense = res.data.driver.idOcrDriverLicense
						this.driveInfo.driverNameOcrDriverLicense = res.data.driver.driverNameOcrDriverLicense
						this.driveInfo.uploadIdCardFlag = res.data.driver.uploadIdCardFlag ? res.data.driver.uploadIdCardFlag : 0
						this.driveInfo.uploadIdCardMsg = res.data.driver.uploadIdCardMsg ? res.data.driver.uploadIdCardMsg : ''
						this.driveInfo.uploadIdCardBackFlag = res.data.driver.uploadIdCardBackFlag ? res.data.driver.uploadIdCardBackFlag : 0
						this.driveInfo.uploadIdCardBackMsg = res.data.driver.uploadIdCardBackMsg ? res.data.driver.uploadIdCardBackMsg: ''
						this.driveInfo.uploadDrivingFlag = res.data.driver.uploadDrivingFlag ? res.data.driver.uploadDrivingFlag : 0
						this.driveInfo.uploadDrivingMsg = res.data.driver.uploadDrivingMsg ? res.data.driver.uploadDrivingMsg : ''
						this.driveInfo.idcardValidDate = res.data.driver.idcardValidDate
						this.driveInfo.driverLcsValidDate = res.data.driver.driverLcsValidDate
						this.driveInfo.idcardStartDate = res.data.driver.idcardStartDate
						this.driveInfo.idcardEndDate = res.data.driver.idcardEndDate
						this.driveInfo.manualIdcardStartTime = res.data.driver.manualIdcardStartTime
						this.driveInfo.manualIdcardEndTime = res.data.driver.manualIdcardEndTime
						this.driveInfo.manualDriveStartTime = res.data.driver.manualDriveStartTime
						this.driveInfo.manualDriveEndTime = res.data.driver.manualDriveEndTime
						this.driveInfo.driverModel = res.data.driver.driverModel
						this.driveInfo.issuingOrganizations = res.data.driver.issuingOrganizations

						this.driveInfo.tqcNo = res.data.driver.tqcNo

						if (res.data.driver.tqc) {
							this.fileTqc = [{
								url: res.data.driver.tqc
							}]
						}
						if (res.data.driver.tqcDeputy) {
							this.fileTqcBack = [{
								url: res.data.driver.tqcDeputy
							}]
						}
						this.fileIdcard = [{
							url: res.data.driver.idcard1
						}]
						this.fileIdcardBack = [{
							url: res.data.driver.idcard2
						}]

						this.fileDriving = [{
							url: res.data.driver.driverLicense
						}]
						this.fileDrivingBack = [{
							url: res.data.driver.drivingLicenseDeputy
						}]
					} else {
						uni.$u.toast(res.msg);
					}
				}).catch(err => {
					console.log(err)
				})
			},
			// 删除图片
			deletePic(event) {
				this[`file${event.name}`].splice(event.index, 1)
				if (!this.fileIdcard.length) {
					this.disableIdcard = true
					this.driveInfo.idcard1 = '';
					this.driveInfo.driverName = '';
					this.driveInfo.idcard = '';
					this.driveInfo.driverNameOcrIdcard = '';
					this.driveInfo.idOcrIdcard = '';
					this.driveInfo.uploadIdCardFlag = '';
					this.driveInfo.uploadIdCardMsg = '';
				}
				if (!this.fileIdcardBack.length) {
					this.driveInfo.idcard2 = ''
					this.driveInfo.idcardValidDate = ''
					this.driveInfo.idcardStartDate = ''
					this.driveInfo.idcardEndDate = ''
					this.driveInfo.manualIdcardStartTime = ''
					this.driveInfo.manualIdcardEndTime = ''
					this.driveInfo.uploadIdCardBackFlag = ''
					this.driveInfo.uploadIdCardBackMsg = ''
				}
				if (!this.fileDriving.length) {
					this.driveInfo.driverLicense = ''
					this.driveInfo.driverStartDate = ''
					this.driveInfo.driverEndDate = ''
					this.driveInfo.driverNameOcrDriverLicense = ''
					this.driveInfo.driverLcsValidDate = ''
					this.driveInfo.idOcrDriverLicense = ''
					this.driveInfo.driverModel = ''
					this.driveInfo.issuingOrganizations = ''
					this.driveInfo.manualDriveStartTime = ''
					this.driveInfo.manualDriveEndTime = ''
					this.driveInfo.uploadDrivingFlag = ''
					this.driveInfo.uploadDrivingMsg = ''
				}
				if (!this.fileTqc.length) {
					this.driveInfo.tqc = ''
					this.driveInfo.tqcNo = ''
				}
			},
			// 身份证正面
			async afterReadIdcard(event) {
				let api = `${this.baseUrl}/driverService/uploadIdcard`
				let lists = [].concat(event.file)
				this[`file${event.name}`].push({
					...event.file,
					status: 'uploading',
					message: '上传中'
				})
				const result = await this.uploadFilePromise(lists[0].thumb, api)
				const res = JSON.parse(result)
				console.log(res)
				if (res.code != 0) {
					uni.$u.toast(res.msg)
					this[`file${event.name}`] = []
				} else {
					this[`file${event.name}`].splice(0, 1, Object.assign(this[`file${event.name}`][0], {
						status: 'success',
						message: '上传成功',
						url: res.data.imgurl
					}))
					this.disableIdcard = false
					this.driveInfo.idcard1 = res.data.imgurl
					this.driveInfo.driverName = res.data.name
					this.driveInfo.idcard = res.data.id
					this.driveInfo.driverNameOcrIdcard = res.data.name
					this.driveInfo.idOcrIdcard = res.data.id
					this.driveInfo.uploadIdCardFlag = res.data.uploadIdCardFlag
					this.driveInfo.uploadIdCardMsg = res.data.uploadIdCardMsg
				}
			},
			// 身份证反面
			async afterReadIdcardBack(event) {
				let api = `${this.baseUrl}/driverService/uploadIdcardBack`
				let lists = [].concat(event.file)
				this[`file${event.name}`].push({
					...event.file,
					status: 'uploading',
					message: '上传中'
				})
				const result = await this.uploadFilePromise(lists[0].thumb, api)
				const res = JSON.parse(result)
				console.log(res)
				if (res.code != 0) {
					uni.$u.toast(res.msg)
					this[`file${event.name}`] = []
				} else {
					this[`file${event.name}`].splice(0, 1, Object.assign(this[`file${event.name}`][0], {
						status: 'success',
						message: '上传成功',
						url: res.data.imgurl
					}))
					console.log(formatDate(res.data.start_date))
					this.driveInfo.idcard2 = res.data.imgurl
					this.driveInfo.idcardValidDate = formatDate(res.data.start_date) + '-' + formatDate(res.data
						.valid_date)
					this.driveInfo.idcardStartDate = formatDate(res.data.start_date)
					this.driveInfo.idcardEndDate = formatDate(res.data.valid_date)
					this.driveInfo.manualIdcardStartTime = formatDate(res.data.start_date)
					this.driveInfo.manualIdcardEndTime = formatDate(res.data.valid_date)
					this.driveInfo.uploadIdCardBackFlag = res.data.uploadIdCardBackFlag
					this.driveInfo.uploadIdCardBackMsg = res.data.uploadIdCardBackMsg
				}
			},
			// 驾驶证正面
			async afterReadDriving(event) {
				let api = `${this.baseUrl}/driverService/upload_driving`
				let lists = [].concat(event.file)
				this[`file${event.name}`].push({
					...event.file,
					status: 'uploading',
					message: '上传中'
				})
				const result = await this.uploadFilePromise(lists[0].thumb, api)
				const res = JSON.parse(result)
				console.log(res)
				if (res.code != 0) {
					uni.$u.toast(res.msg)
					this[`file${event.name}`] = []
				} else {
					this[`file${event.name}`].splice(0, 1, Object.assign(this[`file${event.name}`][0], {
						status: 'success',
						message: '上传成功',
						url: res.data.imgurl
					}))
					this.driveInfo.driverLicense = res.data.imgurl
					this.driveInfo.driverStartDate = formatDate(res.data.driverStartDate)
					this.driveInfo.driverEndDate = formatDate(res.data.driverEndDate)
					this.driveInfo.driverNameOcrDriverLicense = res.data.driverNameOcrDriverLicense
					this.driveInfo.driverLcsValidDate = formatDate(res.data.driverStartDate) + '-' + formatDate(res
						.data.driverEndDate);
					this.driveInfo.idOcrDriverLicense = res.data.idOcrDriverLicense
					this.driveInfo.driverModel = res.data.driverModel
					this.driveInfo.issuingOrganizations = res.data.issuingOrganizations
					this.driveInfo.manualDriveStartTime = formatDate(res.data.driverStartDate)
					this.driveInfo.manualDriveEndTime = formatDate(res.data.driverEndDate)
					this.driveInfo.uploadDrivingFlag = res.data.uploadDrivingFlag
					this.driveInfo.uploadDrivingMsg = res.data.uploadDrivingMsg
				}
			},
			// 从业资格证正面
			async afterReadTqc(event) {
				let api = `${this.baseUrl}/driverService/uploadTqc`
				let lists = [].concat(event.file)
				this[`file${event.name}`].push({
					...event.file,
					status: 'uploading',
					message: '上传中'
				})
				const result = await this.uploadFilePromise(lists[0].thumb, api)
				const res = JSON.parse(result)
				console.log(res)
				if (res.code != 0) {
					uni.$u.toast(res.msg)
					this[`file${event.name}`] = []
				} else {
					this[`file${event.name}`].splice(0, 1, Object.assign(this[`file${event.name}`][0], {
						status: 'success',
						message: '上传成功',
						url: res.data.imgurl
					}))
					this.driveInfo.tqc = res.data.imgurl;
					this.driveInfo.tqcNo = res.data.tqcNo;
				}
			},
			// 新增图片
			async afterRead(event) {
				console.log(event)
				let lists = [].concat(event.file)
				this[`file${event.name}`].push({
					...event.file,
					status: 'uploading',
					message: '上传中'
				})
				const result = await this.uploadFilePromise(lists[0].thumb)
				const res = JSON.parse(result)
				if (res.code != 0) {
					uni.$u.toast(res.msg)
					this[`file${event.name}`] = []
				} else {
					this[`file${event.name}`].splice(0, 1, Object.assign(this[`file${event.name}`][0], {
						status: 'success',
						message: '上传成功',
						url: res.data
					}))
				}
			},
			uploadFilePromise(url, api) {
				return new Promise((resolve, reject) => {
					let upload = uni.uploadFile({
						url: api ? api : `${this.baseUrl}/driverService/upload`,
						filePath: url,
						name: 'file',
						header: {
							Authorization: Cache.get("TOKEN")
						},
						formData: {
							fileType: '2',
							mobile: Cache.get("USERINFO").mobile,
							fileId: Math.floor(Math.random() * 1259),
							ocrOrNot: '1',
							orderId: ''
						},
						success: res => {
							setTimeout(() => {
								resolve(res.data)
							}, 800)
						},
						fail: err => {
							reject(err)
						}
					});
				})
			},
			//	是否有展示更多
			isShowMore(index) {
				if (this.showMore) {
					return true
				} else {
					if (index > 2) {
						return false
					} else {
						return true
					}
				}
			},
			triggerShow() {
				this.showMore = !this.showMore
			},
			goRelation() {
				uni.navigateTo({
					url: "./project/relation"
				})
			},
			goAdd() {
				uni.navigateTo({
					url: './project/addRelation'
				})
			},
			getIp() {
				uni.getSystemInfo({
					success: res => {
						this.driveInfo.macAddress = res.deviceId;
						console.log('macAddress ,', res.deviceId);
					}
				})
				getIp({
					custom: {
						title: '获取ip……'
					}
				}).then(res => {
					console.log(res)
					if (res.code == 0) {
						this.driveInfo.ipAddress = res.data.ip
						console.log(this.driveInfo)
					} else {
						uni.$u.toast(res.msg);
					}
				}).catch(err => {
					console.log(err)
				})
			},
			//	司机编辑提交
			postUpdate() {
				let obj = Object.assign(this.driveInfo, {
					driverId: this.driverId,
					
					isAddDriver:Cache.get("isAddDriver"),
				})
				console.log(obj)
				driverUpdate(obj, {
					custom: {
						title: '提交中……'
					}
				}).then(res => {
					console.log(res)
					if (res.code == 0) {
						uni.$u.toast("提交成功");
						Cache.set("isAddDriver",0)
						this.SAVESELECTPROJECT(null)
						setTimeout(() => {
							uni.navigateTo({
								url: "/pages/driver/index"
							})
						}, 600)
					} else {
						this.driveInfo.projectIds = []
						uni.$u.toast(res.msg);
					}
				}).catch(err => {
					console.log(err)
				})
			},
			//	司机添加提交
			postRegister() {
				console.log(this.driveInfo)
				this.driveInfo.isAddDriver= Cache.get("isAddDriver")
				driverRegister(this.driveInfo, {
					custom: {
						title: '提交中……'
					}
				}).then(res => {
					console.log(res)
					if (res.code == 0) {
						uni.$u.toast("提交成功");
						Cache.set("isAddDriver",0)
						this.SAVESELECTPROJECT(null)
						setTimeout(() => {
							uni.navigateTo({
								url: "/pages/driver/index"
							})
						}, 600)
					} else {
						this.driveInfo.projectIds = []
						uni.$u.toast(res.msg);
					}
				}).catch(err => {
					console.log(err)
				})
			},
			//	提交审核以及提交
			confirm() {
				this.showModal = false
				this.type === 1 ? this.postUpdate() : this.postRegister()
				
			},
			submit() {
				this.user_project.forEach((item) => {
					this.driveInfo.projectIds.push(item.project_id)
				})
				if (this.fileDrivingBack.length) {
					this.driveInfo.drivingLicenseDeputy = this.fileDrivingBack[0].url
				}
				if (this.fileTqcBack.length) {
					this.driveInfo.tqcDeputy = this.fileTqcBack[0].url
				}
				const {
					projectIds,
					idcard1,
					idcard2,
					driverLicense,
					drivingLicenseDeputy,
					tqcDeputy,
					tqc,
					driverName,
					idcard,
					mobile,
					driverNameOcrIdcard,
					idOcrIdcard,
					idOcrDriverLicense,
					driverNameOcrDriverLicense,
					uploadIdCardFlag,
					uploadIdCardBackFlag,
					uploadDrivingFlag,
					idcardValidDate,
					driverLcsValidDate
				} = this.driveInfo
				if (!projectIds.length) {
					uni.$u.toast('请先添加项目！')
					return
				}
				if (!idcard1 || !idcard2 || !driverLicense || !drivingLicenseDeputy || !driverName || !idcard || !mobile) {
					uni.$u.toast('请完善信息！')
					return
				}
				if (!uni.$u.test.mobile(mobile)) {
					uni.$u.toast('您输入的手机号格式不正确！');
					return
				}
				console.log(this.driveInfo)
				if (uploadIdCardFlag == 1) {
					this.contentModal = '您提交的身份证疑似非有效证件，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (uploadIdCardBackFlag == 1) {
					this.contentModal = '您提交的身份证疑似非有效证件，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (uploadDrivingFlag == 1) {
					this.contentModal = '您提交的驾驶证疑似非有效证件，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (!idcardValidDate) {
					this.driveInfo.uploadIdCardFlag = 1;
					this.driveInfo.uploadIdCardMsg = '身份证疑似非有效证件';
					this.contentModal = '您提交的身份证疑似非有效证件，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (!driverLcsValidDate) {
					this.driveInfo.uploadDrivingFlag = 1;
					this.driveInfo.uploadDrivingMsg = '驾驶证疑似非有效证件';
					this.contentModal = '您提交的驾驶证疑似非有效证件，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (driverName != driverNameOcrIdcard) {
					this.driveInfo.uploadIdCardFlag = 1;
					this.driveInfo.uploadIdCardMsg = '真实姓名和身份证证件不一致';
					this.contentModal = '您提交的真实姓名和身份证证件不一致，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (driverName != driverNameOcrDriverLicense) {
					this.driveInfo.uploadDrivingFlag = 1;
					this.driveInfo.uploadDrivingMsg = '真实姓名和驾驶证证件不一致';
					this.contentModal = '您提交的真实姓名和驾驶证证件不一致，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (idcard != idOcrIdcard) {
					this.driveInfo.uploadIdCardFlag = 1;
					this.driveInfo.uploadIdCardMsg = '输入身份证号和身份证证件不一致';
					this.contentModal = '您提交的输入身份证号和身份证证件不一致，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (idcard != idOcrDriverLicense) {
					this.driveInfo.uploadDrivingFlag = 1;
					this.driveInfo.uploadDrivingMsg = '输入身份证号和和驾驶证证件不一致';
					this.contentModal = '您提交的输入身份证号和和驾驶证证件不一致，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (idcard != idOcrDriverLicense) {
					this.driveInfo.uploadDrivingFlag = 1;
					this.driveInfo.uploadDrivingMsg = '输入身份证号和和驾驶证证件不一致';
					this.contentModal = '您提交的输入身份证号和和驾驶证证件不一致，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (Date.parse(this.driveInfo.idcardEndDate) + 24*60*60*1000 < new Date().getTime()) {
					this.driveInfo.uploadIdCardFlag = 1;
					this.driveInfo.uploadIdCardMsg = '身份证已过期';
					this.contentModal = '您提交的身份证已过期，请重新修改后再提交'
					this.showModal = true
					return
				}
				if (Date.parse(this.driveInfo.driverEndDate) + 24*60*60*1000 < new Date().getTime()) {
					this.driveInfo.uploadDrivingFlag = 1;
					this.driveInfo.uploadDrivingMsg = '驾驶证已过期';
					this.contentModal = '您提交的驾驶证已过期，请重新修改后再提交'
					this.showModal = true
					return
				}
				this.confirm()
			}
		},
		computed: {
			...mapGetters(['selectProject'])
		},
	}
</script>

<style lang="scss">
	page {
		background: #fafafa;
		width: 100vw;
		height: 100vh;
		box-sizing: border-box;
	}

	.wrap {
		width: 100vw;
		height: 100vh;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		box-sizing: border-box;
	}

	.content {
		width: 100%;
		overflow: auto;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: calc(90rpx + env(safe-area-inset-bottom));
	}

	.between {
		display: flex;
		align-items: center;
		justify-content: space-between;

		.set {
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 26rpx;
			font-weight: 500;
			color: #9E9E9E;
			padding-left: 24rpx;
		}
	}

	.item {
		padding-top: 20rpx;
		background: #fff;
		margin: 18rpx 0;

		.items {
			padding: 0 32rpx;

			.info {
				padding: 12rpx 0;

				.name {
					font-size: 30rpx;
					font-weight: 400;
					color: #333333;
					line-height: 66rpx;
				}
			}

			.fold {
				border-top: 1rpx solid #F5F7FB;
			}

			.fold>view {
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 30rpx;
				font-weight: 400;
				color: #9E9E9E;
				padding: 20rpx 0;
				border-top: 1rpx solid #F5F7FB;
			}
		}

		.unselected {
			padding: 48rpx 0;
			width: 100%;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 30rpx;
			font-weight: 500;
			color: #9E9E9E;

			.flex {
				box-sizing: border-box;
				width: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
				border: 1px dashed #979797;
				padding: 24rpx 0;
				border-radius: 10rpx;
			}
		}

		.tips {
			font-size: 26rpx;
			font-weight: 400;
			color: #9E9E9E;
			line-height: 36rpx;
			padding-bottom: 24rpx;
		}

		.title {
			padding: 0 32rpx 0 24rpx;
			border-left: 8rpx solid #003E81;
			font-size: 34rpx;
			font-weight: 500;
			color: #333;
		}

		.info-wrap {
			padding: 24rpx 32rpx 0;
		}

		.upload-box {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.upload-item {
				width: 50%;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;

				.u-upload__wrap__preview {
					margin: 0 !important;
				}

				.desc {
					font-size: 24rpx;
					font-weight: 400;
					line-height: 2;
					color: #666;
					margin-top: 12rpx;
				}
			}
		}
	}

	.bottom-wrap {
		position: absolute;
		left: 0;
		bottom: calc(10rpx + env(safe-area-inset-bottom));
		width: 100vw;
		padding: 0 32rpx;
		box-sizing: border-box;

		.submit {
			width: 100%;
			font-size: 30rpx;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 80rpx;
			border-radius: 12rpx;
			text-align: center;
			background: linear-gradient(to right, #4d83b9, #003E81);
		}
	}
</style>
